package tool

// by daoyi
import (
	"fmt"
	"log"
	"os"
)

func InitLog() {
	time := GetDay()
	logFile, err := os.OpenFile("./static/log/"+time+".log", os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0666)
	if err != nil {
		fmt.Println("open log file failed, err:", err)
		return
	}
	log.SetOutput(logFile)
	log.SetFlags(log.Llongfile | log.Lmicroseconds | log.Ldate)

	log.Println(">>>>日志服务启动中...")
	log.SetPrefix("[PS]")
	log.Println("日志服务启动成功...")
}
